package com.zp.qualitypractice.Mvp;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.ImageView;
import android.widget.Toast;

import com.bumptech.glide.Glide;
import com.zp.qualitypractice.Bean.BeanSplash;
import com.zp.qualitypractice.R;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by izp on 2017/4/14.
 */

public class SplashActivity extends BaseActivity<MvpSplash.Presenter> implements MvpSplash.View {

    @BindView(R.id.iv_splash)
    ImageView ivSplash;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        ButterKnife.bind(this);
        mPresenter.getSplashBean();
    }

    @Override
    protected MvpSplash.Presenter createPresenter() {
        return new PresenterSplash();
    }

    @Override
    public void bindPresenter() {
        mPresenter = new PresenterSplash();
    }

    @Override
    public void showSplash(BeanSplash beanSplash) {
        Glide.with(this)
                .load(beanSplash.getImageUrl())
                .into(ivSplash);
        Toast.makeText(this, beanSplash.toString(), Toast.LENGTH_SHORT).show();
    }
}
